<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/commons/taglibs.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>会员登录</title>
<style type="text/css">
body{background: url('${ctx }/images/login_background.png') no-repeat;}
form{padding: 0 ;margin: 0}
.bt14A {font-family: "宋体";font-size: 14px;padding: 8px 5px 8px 15px;color: #666666;}
.nw12a {font-family: "宋体";font-size: 12px;line-height: 22px;padding:5px 10px 5px 10px;}
.btn_login{width: 84px;height:34px;font-size: 14px;font-weight: bold;line-height: 34px;text-align: center;cursor: pointer;text-shadow: 0px 1px 0px #E9FDE5;}
</style>

<script type="text/javascript" src="${ctx }/js/jquery-1.3.2.js"></script>
<script type="text/javascript" src="${ctx }/js/common.js"></script>
<script type="text/javascript">

function checkLogin()
{
  var username = $("#j_username").val();
  if(!checkMobilePhone(username)){
	  $("#username").focus();
	  alert("请正确填写手机号码。");
	  return false;
  }

  var j_password = $("#j_password").val();
  if(j_password == ""){
	  alert("请填写会员密码。");
	  $("#j_password").focus();
      return false;
  }

  var _captcha_parameter = $("#_captcha_parameter").val();
  if(_captcha_parameter == ""){
	  alert("请填写验证码。");
	  $("#_captcha_parameter").focus();
      return false;
  }

	var bid_id = parent.document.getElementById("bid_id_hiddden").value;
	var new_price = parent.document.getElementById("new_price_hiddden").value;
	var page_title = parent.document.getElementById("page_title_hiddden").value;
	var remain_time = parent.document.getElementById("remain_time_hiddden").value;
    $("#bid_id").val(bid_id);
    $("#new_price").val(new_price);
    $("#page_title").val(page_title);
    $("#remain_time").val(remain_time);

  $("#loginForm").submit();

  return ;
}

/***** 去注册 begin ********/
function gotoRegister(){
	var bid_id = parent.document.getElementById("bid_id_hiddden").value;
	var new_price = parent.document.getElementById("new_price_hiddden").value;
	var page_title = parent.document.getElementById("page_title_hiddden").value;
	var remain_time = parent.document.getElementById("remain_time_hiddden").value;
    $("#bid_id_register").val(bid_id);
    $("#new_price_register").val(new_price);
    $("#page_title_register").val(page_title);
    $("#remain_time_register").val(remain_time);

    $("#registerForm").submit();
}
/***** 去注册 end ********/

/******** 刷新验证码 begin *************/
function refreshImage()
{
	var imgObj = document.getElementById("captcha");
	imgObj.src = "${ctx}/servlet/captcha.jpg?" + new Date().getTime();
}
/******** 刷新验证码 end *************/

function closeWin(){

	parent.closePopupDiv("_link_div_win");
}

function init_message(){

	var errorMessage = '${requestScope.errormessge}';

	if(errorMessage != ''){
		alert(errorMessage);
	}
}

$(function(){
	var uName = getCookie("kg_customer");
	$("#j_username").val(uName);
	init_message();
});
	
</script>
	
</head>

<body>

<form action="${ctx }/customer/customerAction!login_bid.do" method="post" name="loginForm" id="loginForm">
	<table border="0" cellpadding="0" cellspacing="0" style="margin: 20px 0px 0px 30px;">
		 <tr>
		 	<td colspan="2">
			  	<div style="margin: 3px 0px 20px 5px;">
			  		<span><img src="${ctx }/images/login2.jpg" style="vertical-align: bottom;"/></span>
			  	</div>
		     </td>
		  </tr>
		  <tr>
		    <td class="bt14A" align="right">手机号码：</td>
		    <td><input type="text" name="j_username" id="j_username"/></td>
		  </tr>
		  <tr>
			  <td class="bt14A" align="right">密码：</td>
			  <td><input type="password" name="j_password" id="j_password"/>
		      <span class="nw12a">找回密码</span></td>
		  </tr>
		  <tr>
			<td style="font-family: 宋体;font-size: 14px;color: #666666;" align="right">验证码：</td>
			<td style="font-family: 宋体;font-size: 14px;">
				<input type="text" name="_captcha_parameter" id="_captcha_parameter" size="8"/>
				<img id="captcha" src="${ctx }/servlet/captcha.jpg" title="点击刷新图片" alt="点击刷新图片"
					onclick="javascript:refreshImage();" style="cursor: pointer; border: 0px;vertical-align: middle;"/>
				<a href="javascript:refreshImage();">换一张图</a></td>
		  </tr>
		  <tr>
			    <td height="50">
			   		<input type="hidden" name="login_from" id="login_from" value="bid"/>
			    	<input type="hidden" value="" name="bid_id" id="bid_id"/>
					<input type="hidden" value="" name="new_price" id="new_price"/>
					<input type="hidden" value="" name="page_title" id="page_title"/>
					<input type="hidden" value="" name="remain_time" id="remain_time"/>
			    </td>
			    <td class="bt14A">
			     	<input type="button" value="登 录" onclick="javascript:checkLogin();" class="btn_login"/> 
			    </td>
		  </tr>
		  <tr>
		  	<td></td>
		  	<td  class="bt14A"><a href="javascript:gotoRegister()" style="color: blue">新会员注册</a></td>
		  </tr>
	</table>
 </form>
 
<div style="position: absolute;left: 351px;top: 13px;">
	<img src="${ctx }/images/close.gif" width="16" height="16" style="cursor: pointer;" onclick="closeWin()"/>
</div>
 
<form action="${ctx }/customer/customerAction!registerPrepare.do" method="post" name="registerForm" id="registerForm" target="_top">
   	<input type="hidden" value="" name="bid_id_register" id="bid_id_register"/>
	<input type="hidden" value="" name="new_price_register" id="new_price_register"/>
	<input type="hidden" value="" name="page_title_register" id="page_title_register"/>
	<input type="hidden" value="" name="remain_time_register" id="remain_time_register"/>
</form>

</body>
</html>